{extend name="template/base" /}
{block name="content"}
<div class="page-container" style="width: 80%;margin: 0 auto;">
    <div class="cl pd-5 bg-1 bk-gray" style="margin-bottom:15px;">
		<input style="margin-left:15px;background-color:#28a3ef;color:#fff;" class="btn" id="btnPrint" type="button" value="打印学员信息" onclick="preview(1)" />
    </div>
	<!-- 表单 -->
	<!--startprint1-->
		<style>
			body{}
			@page {size: A4 landscape;}
			.border-just-has-bottom{border:1px solid #fff;border-bottom:1px solid #000;}
			.border-just-has-top{border:1px solid #fff;border-top:1px solid #000;}
			.border-left-right{border:1px solid #fff;border-left:1px solid #000;border-right:1px solid #000;}
			.border-left{border:1px solid #fff;border-left:1px solid #000;}
			.border-right{border:1px solid #fff;border-right:1px solid #000;}
			.border-none{border:1px solid #fff;}
			.print_table{width:25cm;margin-left:20px;}
			.print_table td{padding-left:2px;font-size:16px !important;}
			.print_table .serial{height:30px;border:none;font-size:16px;padding-bottom:2px;}
			.card_type {background-color: #FFF; border: 1px solid #000;height:16px;width:16px;
				display: inline-block; margin: 0 25px 0 2px;
			}
			.card_type img{height:16px;width:16px;padding:0;margin:0 0 8px 0px;}
		</style>
		<table border="1" class="print_table">
		  <tr class="border-none" style="">
			<td colspan="9" style="text-align:center;">
				<span style="font-size:20px;font-weight:600;">{$info.title}</span>
			</td>
		  </tr>
		  <tr class="border-none" style="height:30px;">
			<td class="border-just-has-bottom" colspan="1">培训单位:</td>
			<td class="border-just-has-bottom" colspan="5">{$info.company|nl2br}</td>
			<td class="border-just-has-bottom" colspan="3">NO:(序号)<input class="serial"  name="serial" value="{$member.serial}" /></td>
		  </tr>
		  <tr>
			<td width="70px;">姓名</td>
			<td width="60px;">{$member.name}</td>
			<td width="60px;">性别</td>
			<td width="60px;">{$member.sex}</td>
			<td width="60px;">身份证</td>
			<td>{$member.card_num}</td>
			<td width="90px;">培训日期</td>
			<td width="90px;">{$member.edu_date}</td>
			<td rowspan="3" style="width:3.6cm;height:5cm;text-align:center;vertical-align:middle;">
				{if condition="empty($member.avator)"}
					相片
				{else /}
					<img style="width:3.5cm;height:4.9cm;"	src="/cheguan/{$member.avator}" />
				{/if}
			</td>
		  </tr>
		  <tr>
			<td>家庭住址</td>
			<td colspan="4">{$member.address}</td>
			<td>联系方式</td>
			<td colspan="2">{$member.mobile}</td>
		  </tr>
		  <tr>
			<td>申请车型</td>
			<td colspan="7">
			{volist name="card_type" id="vo" key="k"}
				<input class="check" style="display:none;" type="radio" name="CheckboxGroup1" data-k="{$k}" id="check{$k}" value="0" />
				{$vo.name}
				{if condition="$member.car_type eq $vo.id"}
					<label for="check{$k}" id="label{$k}" class="card_type"><img src='__STATIC__/images/check.png' /></label>
				{else /}
					<label for="check{$k}" id="label{$k}" class="card_type"></label>
				{/if}
			{/volist}
			</td>
		  </tr>
		  <tr style="height:60px;border">
			<td>培训内容</td>
			<td colspan="7">{$info.content|nl2br}</td>
			<td colspan="1" style="vertical-align:top;text-align:center;">实时抓拍照片</td>
		  </tr>
		  <tr class="border-none"  style="height:90px;">
			<td class="border-just-has-top" style="border-top:1px solid #000;" colspan="5">安全学习培训讲师：（签章）</td>
			<td class="border-just-has-top" style="border-top:1px solid #000;" colspan="4" >安全学习培训单位：（盖章）</td>
		  </tr>
		  <tr style="height:90px;">
			<td class="border-none"  colspan="5">应急救护培训讲师：（签章）</td>
			<td class="border-none"  colspan="4" >应急救护培训单位：（盖章）</td>
		  </tr>
		  <tr>
			<td class="border-none"  colspan="9">注：{$info.remark|nl2br}</td>
		  </tr>
		</table>
	<!--endprint1-->
</div>
{/block}
{block name='script'}
<script>
	var HKEY_Root,HKEY_Path,HKEY_Key;   
	HKEY_Root="HKEY_CURRENT_USER";   
	HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";   
	//设置网页打印的页眉页脚为空 ，仅IE浏览器可用  
	function PageSetup_Null()   
	{   
		try   
		{   
			var Wsh=new ActiveXObject("WScript.Shell");   
			HKEY_Key="header";   
			Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");   
			HKEY_Key="footer";   
			Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");   
		}   
		catch(e)   
		{}   
	}   
	  
	//设置网页打印的页眉页脚为默认值 ，仅IE浏览器可用  
	function PageSetup_Default()   
	{   
		try   
		{   
			var Wsh=new ActiveXObject("WScript.Shell");   
			HKEY_Key="header";   
			Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");   
			HKEY_Key="footer";   
			Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");   
		}   
		catch(e)   
		{}   
	}
	function preview(oper)         
	{  
		if (oper < 10)  
		{  
			try{
                print.portrait   =  false    ;//横向打印 
            }catch(e){
                alert("浏览器不支持程序设置横向打印，如需横向打印请在打印时对打印机设置横向打印");
            }
			bdhtml=window.document.body.innerHTML;//获取当前页的html代码

			sprnstr="<!--startprint"+oper+"-->";//设置打印开始区域  
			eprnstr="<!--endprint"+oper+"-->";//设置打印结束区域  
			prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //从开始代码向后取html  
			prnhtmlprnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html		
			window.document.body.innerHTML=prnhtml; 
			window.frames.focus();//由于使用frame弹窗，为了防止IE打印到父级页面，这里加上这句只打印iframe
			if (!!window.ActiveXObject || "ActiveXObject" in window) { //是否ie
				PageSetup_Default();
				PageSetup_Null();
			}
			$(".check").eq(1).attr("checked","checked");
			window.document.close();			
			window.print();  
			window.document.body.innerHTML=bdhtml;
			document.getElementByTagName("body").style.margin="20px";			
		}
		else 
		{   
			document.getElementById("info").style.marginLeft="-100px";
			window.print();  
		}  
	}
	
	$(document).ready(function () {  //选择区域
		var img="<img src='__STATIC__/images/check.png' />";
		$(".check").change(function() {
			var k=$(this).attr("data-k");
			$(".card_type").html("");
			$("#label"+k).html(img);
		});
	});
</script>  
{/block}
